<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AlbumList.ascx.cs" Inherits="admin_webparts_Plug_ins_Images_AlbumList" %>

<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.Web.BL.ImageAlbum" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>


<div class="tip">
	<h1><%=LanguageUtility.GetLanguageText("IMAGE_ALBUM_MANAGEMENT", Session)%></h1>
    <div style="display: block; width: 32px; height: 32px; float: right; position: relative; top: -27px;"><a title="<%=LanguageUtility.GetLanguageText("CLICK_RETURN", Session) %>" href="?type=<%=Request.QueryString["type"] %>"><img src="resources/images/Back.png" alt="" /></a></div>
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
	<tr>
        <td align="left" style="padding-bottom: 10px;">
            <span id="addLink" class="yui-button yui-link-button"><span class="first-child"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=albumadd" tabindex="0" id="loggerLink-button"><%=LanguageUtility.GetLanguageText("ADD_NEW", Session)%></a></span></span>
            <script type="text/javascript">
                YAHOO.util.Event.onContentReady("addLink", function () {
                        var oAddLink = new YAHOO.widget.Button("addLink");
                    });
            </script>
        </td>
    </tr>
    <tr>
        <td align="left">
            <table border="1" cellpadding="0" cellspacing="0" class="grid" id="tbGrid">
                <tr>
                    <th width="42px">#</th>
                    <th><%=LanguageUtility.GetLanguageText("NAME", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("LINK", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("PRESENTATIVE_IMAGE", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("DEFAULT_SIZE", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("MINI_SIZE", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("IMAGE_PATH", Session)%></th>
                    <th><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%></th>
                    <th width="42px"><%=LanguageUtility.GetLanguageText("EDIT", Session)%></th>
                </tr>
                <%if (this._AlbumList != null) for (int i = 0; i < this._AlbumList.Rows.Count; i++)
                      {
                          System.Data.DataRow row = this._AlbumList.Rows[i]; %>
                <tr class="<%=(i%2==1?"even":"odd") %>">
                    <td align="center"><%=i + 1 %></td>
                    <td align="left"><a href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=viewalbum&albumid=<%=row[ImageAlbum.ID__COLUMN_NAME] %>"><b><%=row[ImageAlbum.ALBUMNAME__COLUMN_NAME] %></b></a></td>
                    <td align="left"><%=row[ImageAlbum.LINKURL__COLUMN_NAME]%></td>
                    <td align="center">
                        <a href="../<%=row[ImageAlbum.IMAGEPATH__COLUMN_NAME].ToString() + row[ImageAlbum.IMAGE__COLUMN_NAME].ToString() %>" target="_blank">
                            <img src="ImageProvider.aspx?imgurl=<%=Server.UrlEncode(row[ImageAlbum.IMAGEPATH__COLUMN_NAME].ToString() + row[ImageAlbum.IMAGE__COLUMN_NAME].ToString())%>" alt="" style="max-width: 100px; max-height: 75px;" />
                        </a>
                    </td>
                    <td align="center"><%=row[ImageAlbum.DEFAULTWIDTH__COLUMN_NAME] %> x <%=row[ImageAlbum.DEFAULTHEIGHT__COLUMN_NAME] %></td>
                    <td align="center"><%=row[ImageAlbum.MINIDEFAULTWIDTH__COLUMN_NAME] %> x <%=row[ImageAlbum.MINIDEFAULTHEIGHT__COLUMN_NAME] %></td>
                    <td align="left"><%=row[ImageAlbum.IMAGEPATH__COLUMN_NAME] %></td>
                    <td align="center"><%=((int)row[ImageAlbum.ACTIVE__COLUMN_NAME] == 1 ? "<img src=\"resources/images/active_l.png\"" : "<img src=\"resources/images/inactive_l.png\"")%></td>
                    <td align="left">
                        <ul class="icon" style="width: 84px;">
                            <li><a title="<%=LanguageUtility.GetLanguageText("EDIT", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=albumedit&id=<%=row[ImageAlbum.ID__COLUMN_NAME] %>" class="icon editbn">&nbsp</a></li>
                            <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_UP", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=movealbumup&albumid=<%=row[ImageAlbum.ID__COLUMN_NAME] %>" class="icon ascbn">&nbsp</a></li>
                            <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_DOWN", Session)%>" href="?type=<%=Request.QueryString["type"] %>&name=<%=Request.QueryString["name"] %>&action=movealbumdown&albumid=<%=row[ImageAlbum.ID__COLUMN_NAME] %>" class="icon descbn">&nbsp</a></li>
                        </ul>
                    </td>
                </tr>
                <%} %>
            </table>
        </td>
    </tr>
</table>